FROM registry.cn-hangzhou.aliyuncs.com/qingcloudtech/base-java:latest AS build

ENV APPLICATION qingcloud-fexecutor
ENV PARAMS=""

ENV USERNAME="develop"
ENV WORKSPACE="-DcomponentWorkDir=/app/workspace"
ENV JVMOPTIONS=""

WORKDIR /app/service/$APPLICATION
COPY target/config config/
COPY target/$APPLICATION.jar .

ENV APP_OPTS="-Xms1024m -Xmx1024m -XX:+UseG1GC -XX:MaxMetaspaceSize=512m -Dsun.jnu.encoding=utf-8 -Duser.timezone=GMT+08 -Dfile.encoding=utf-8 \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens java.base/java.io=ALL-UNNAMED \
--add-opens java.base/java.net=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED \
--add-opens java.base/java.net=ALL-UNNAMED \
--add-opens java.base/java.util.concurrent=ALL-UNNAMED \
--add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED \
--add-opens java.base/java.math=ALL-UNNAMED \
"


EXPOSE 48081
ENTRYPOINT ["sh","-c","java ${JVMOPTIONS} ${APP_OPTS} ${WORKSPACE} -jar $APPLICATION.jar ${PARAMS}"]
LABEL com.qingcloud.version=1.1.1
LABEL com.qingcloud.name=qingcloudtech/$APPLICATION